/*
 * @lc app=leetcode.cn id=1003 lang=cpp
 *
 * [1003] 检查替换后的词是否有效
 */

// @lc code=start
#include <bits/stdc++.h>
using namespace std;
class Solution {
public:
    bool isValid(string s) {
        size_t pos = s.npos;
        while ((pos = s.find("abc")) != s.npos)
        {
            s.erase(pos, 3);
        }
        

        return s == "";
    }
};
// @lc code=end

